<?php echo $html->script('cart'); ?>
<?php echo $this->Html->css('deal'); ?>
<?php echo $this->Html->css('category'); ?>
<?php echo $this->Html->css('search'); ?>

<div class="catmain" style="padding:30px 30px">
    <div class="title" style="margin-bottom: 15px">Your cart</div>
<?php if (array() == $deals) { ?>
    <div class="">
        You don't have any item on your cart
    </div>
<?php 
	} 
	else { 
		foreach($deals as $deal):
			echo $this->element('deal',array('deal' => $deal, 'page' => 'cart'));
		endforeach;
	?>
	<a class="add_to_cart btn" style="text-decoration: none;" href='<?=$this->webroot?>users/payment'>Proceed to payment</a>
    <div class="pagination"></div>
    <?php } ?>
</div>
<script>
$(document).ready(function() {
    $(".remove_from_cart").click(function(event) {
        var id = event.target.id;
        id = id.substring(0, id.indexOf('_'));
        $('#deal_' + id).remove();
    });
});
</script>
